package com.alvin.demo.utils;

import javax.servlet.http.HttpServletRequest;

public class RequestUtils {

    // 判断是否为Ajax请求
    public static boolean isAjaxRequest(HttpServletRequest request) {
        String isAxios = request.getHeader("X-Is-Axios");
        return "true".equals(isAxios);
    }

    // 判断是否为url请求
    public static boolean isStandardUrlRequest(HttpServletRequest request) {
        return !isAjaxRequest(request);
    }

}
